<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function bank(num) {
        let eat = prompt("请输入本月的食宿消费金额：");
        let life = prompt("请输入本月的生活消费金额：");
        num = num - eat - life;
        return num;
      }
      let balance = bank(prompt("请输入银行卡余额："));
      alert("您的银行卡还剩：" + balance + "元");
    </script>
  </body>
</html>
